#include<stdlib.h>
#include<stdio.h>
#include<sys/wait.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<string.h>

int main(){
    int fd = open("myfifo", O_WRONLY);
    if(fd < 0){
        perror("open");
        exit(1);
    }

    printf("open write fifo succsess!\n");
    while(1){
        char buff[1024];
        fgets(buff, 1024, stdin);
        if(strncmp(buff,"quit",4) == 0){
            break;
        }

        write(fd, buff, strlen(buff));
    }
    return 0;
}